import Cookies from 'js-cookie'
import {GetP} from '@/utils/GetP'
const Query = 'cps_user_query'

export function setQuery(id) {
  return Cookies.set(Query, id)
}

export function getQuery() {
  let data=JSON.parse(Cookies.get(Query))
  let p=GetP(unescape(data.p));
  let pro_id=data.pro_id ||((data.userid<60000000000&&data.userid>50000000000)&&3)|| ((data.userid<70000000000&&data.userid>60000000000)&&4)||3;
  data=Object.assign(data,{p,pro_id})
  return data
}

export function removeQuery() {
  return Cookies.remove(Query)
}

